package com.cn.serverline.lineicp.produce.mapper;

import com.cn.serverline.lineicp.produce.entity.TeExceptionSecalation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.serverline.lineicp.produce.entity.dto.TeExceptionRecordsDto;
import com.cn.serverline.lineicp.produce.entity.dto.TeExceptionSecalationDto;
import com.cn.serverline.lineicp.produce.entity.vo.TeExceptionRecordsVo;
import com.cn.serverline.lineicp.produce.entity.vo.TeExceptionSecalationVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 异常上报表 Mapper 接口
 * </p>
 *
 * @author 王凯炫
 * @since 2024-08-22
 */
public interface TeExceptionSecalationMapper extends BaseMapper<TeExceptionSecalation> {


    List<TeExceptionSecalationVo> sel(@Param("dto") TeExceptionSecalationDto dto, @Param("start") Date start, @Param("end") Date end);

    List<TeExceptionSecalationVo> sele(@Param("dto") TeExceptionSecalationDto dto, @Param("start") Date start, @Param("end") Date end);


    @Select("select  su.ACCOUNT,su.REAL_NAME,ter.PRODUCT_CONTENTS,ter.CREATE_TIME，ter.HANDLE_WAY\n" +
            "\n" +
            "FROM TE_EXCEPTION_RECORDS ter\n" +
            "\n" +
            "LEFT JOIN SYS_USER su ON  ter.USER_ID = su.USER_ID\n" +
            "\n" +
            "WHERE ter.EXCEPTION_SECALATION_ID = #{exceptionSecalationId}")
    List<TeExceptionRecordsVo> select(TeExceptionRecordsDto teExceptionRecordsDto);
}
